<template>
  <div class="box">
    <el-form size="medium"  ref="userForm" label-width="100px">
      
      <el-form-item label="审核备注">
        <el-input type="textarea" rows="4" placeholder="请输入商品审核备注" v-model="obj.audit_remark"></el-input>
      </el-form-item>
     
      <el-form-item>
        <el-button type="primary" @click="auditPro(1)">通过</el-button>
        <el-button @click="auditPro(0)">拒绝</el-button>
      </el-form-item>
    </el-form>
  </div>

</template>
<script>
import { auditPro } from '@/api/mall/product';
export default {
  name: 'auditPro',
  data() {
    return {
      // obj: {
      //   update_time: '',
      //   id: '',
      //   audit: '',
      //   audit_remark: ""
      // },
      isLoading: false
    }
  },
  props: {
    obj:{
      type:Object,
      default:function(){
        return {};
      }
    }
  },
  computed: {},
  methods: {
    //审核商品
    auditPro(tag){
      let _data = Object.assign({},this.obj);
      if(Boolean(tag)){
        //通过
        _data.audit = 1;
      }else{
        //拒绝
        _data.audit = 0;
      };

      //提交数据
      this.isLoading = true;
      auditPro(_data).then(res => {
        this.isLoading = false;
        this.$emit('success');
      });
    }
  }
}
</script>

<style lang="scss" scoped>
.el-input {
  width: 270px;
}

.box {
  width: 100%;
  /*padding: 60px;
  height: calc(100vh - 77px);
  overflow: scroll;*/
}
</style>
